package wanbang.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import wanbang.service.BuybookService;

@Controller
public class BuybookController {
	@Autowired
	private BuybookService buybookService;
	@ResponseBody
	@RequestMapping("/showBook")
	public Map<String,Object> showBook(Integer currentPage,Integer numberPage){
		return  this.buybookService.selectBookByLimit(currentPage, numberPage);
	}
	@RequestMapping("/buyBook")
	public void buyBook(Integer bookId ,Integer userId){
		this.buybookService.buyBook(bookId, userId);	 
	}
}
